home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / INCLUDES / I3DEXRFT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  13.1 KB  |  434 lines

  1. /* $Id: I3DExRft.h 1.17 1997/06/24 17:43:19 Logan Exp $ */
  2.  
  3. /*****************************************************************************\
  4. *                                                                             *
  5. * I3DXRFtr.h                                                                            *
  6. *   Render feature definition                                                 *
  7. *                                                                             *
  8. *           Copyright (c) 1996, Fractal Design Corp. All rights reserved.     *
  9. *                                                                             *
  10. \*****************************************************************************/
  11.  
  12. #ifndef __I3DEXRFT__
  13. #define __I3DEXRFT__
  14.  
  15. #ifndef __3DCOTYPE__
  16. #include "3DCoType.h"
  17. #endif
  18.  
  19. #ifndef __ISH3DFIL__
  20. #include "ISh3DFil.h"
  21. #endif
  22.  
  23. #ifndef __I3DEX__
  24. #include "I3DEx.h"
  25. #endif
  26.  
  27. #ifndef __I3DSHUTI__
  28. #include "I3DShUti.h"
  29. #endif
  30.  
  31. #ifndef __I3DSHAB__
  32. #include "I3DSHAB.H"
  33. #endif
  34.  
  35. struct I3DShGroup;
  36. struct I3DShLightsource;
  37.  
  38.  
  39. struct IllumSettings {
  40.     short            fShadowsOn;
  41.     short            fReflectionOn;
  42.     short            fTransparencyOn;
  43.     short            fLightThroughTransp;
  44.     short            fBumpOn;
  45.     short            fRefractionOn;
  46.     long            fMaxRayDepth;
  47.     };
  48.     
  49.  
  50. //****** Globally Unique Id **************************************************
  51. //mirrored in CDEFS.H
  52. DEFINE_GUID(IID_I3DExIllumModel, 0x817684AA, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
  53.  
  54.  
  55. #undef INTERFACE
  56. #define INTERFACE I3DExIllumModel
  57.  
  58. struct RTLevelInfo { 
  59.     NUM3D ratio;
  60.     short ref;
  61.     short trans;
  62.     short action; 
  63.     short reserved;
  64.     };
  65.  
  66.  
  67.     
  68. DECLARE_INTERFACE_(I3DExIllumModel, IUnknown) {
  69.     // IUnknown methods
  70.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  71.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  72.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  73.  
  74.     // IID_I3DExIllumModel methods
  75.   STDMETHOD(LightBeam) (THIS_ const Ray3D &aR,I3DShInstance *self,
  76.                 NUM3D tmin,NUM3D tmax,COLOR3D &filterColor, unsigned long& numberOfRays) PURE;
  77.     STDMETHOD(GetRayColor) (THIS_ const RayHitParameters ¶ms,
  78.                                                 const VECTOR2D theScreenUV,
  79.                                                 const Ray3D &theray,const RTLevelInfo &level,
  80.                                                 COLOR3D &resColor, ShadingOut &shadingOut,
  81.                                                 RayHit3D    &hit, unsigned long& numberOfRays, NUM3D* maskResult);
  82.     };
  83.  
  84.  
  85.  
  86.  
  87.  
  88. //****** Globally Unique Id **************************************************
  89. //mirrored in CDEFS.H
  90. DEFINE_GUID(IID_I3DExRenderFeature, 0x817684A5, 0x8B35, 0x11D0, 0xA5, 0x04A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
  91.  
  92. typedef struct RendFtrCommonIn {
  93.     VECTOR3D fInGPos;
  94.     
  95.     }RendFtrCommonIn;
  96.  
  97.  
  98. #undef INTERFACE
  99. #define INTERFACE I3DExRenderFeature
  100.  
  101.  
  102. DECLARE_INTERFACE_(I3DExRenderFeature, I3DExDataExchanger) {
  103.     // IUnknown methods
  104.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  105.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  106.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  107.  
  108.     // I3DExtension methods
  109.     STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
  110.     STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
  111.  
  112.   // I3DExDataExchanger methods
  113.     STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE;    // Return NULL if GetResID is to be used
  114.     STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
  115.   STDMETHOD(ExtensionDataChanged) (THIS) PURE;
  116.   STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
  117.     STDMETHOD_(short, GetResID) (THIS) PURE;
  118.  
  119.     // I3DExRenderFeature methods
  120.   STDMETHOD(FrameJuncture) (THIS_ I3DShInstance* theInstance, Boolean moreFrames) PURE;
  121.     };
  122.         
  123.     
  124.  
  125. #if 0
  126.     //this will become a separate interface
  127.     STDMETHOD_(BOOLEAN, TakesFacetStream) (THIS) PURE;
  128.     STDMETHOD(FacetStreamInit) (THIS) PURE;
  129.     STDMETHOD(FacetStreamFeed) (THIS) PURE;    //xxx add facet param
  130.     STDMETHOD(FacetStreamEnd) (THIS) PURE;
  131. #endif
  132.  
  133.  
  134.  
  135. //****** Globally Unique Id **************************************************
  136. //mirrored in CDEFS.H
  137. DEFINE_GUID(IID_I3DExAbufAccessor, 0x817684AC, 0x8B35, 0x11D0, 0xA5, 0x04A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
  138.  
  139. #undef INTERFACE
  140. #define INTERFACE I3DExAbufAccessor
  141.  
  142. DECLARE_INTERFACE_(I3DExAbufAccessor, IUnknown) {
  143.     
  144.     //fragment access
  145.     STDMETHOD_(void*, GetNthFrag) (THIS_ long h, long v, long N) PURE;
  146.     
  147.     //privdata access
  148.     STDMETHOD_(void*, GetPrivData)(THIS_ void* voidFrag, unsigned long token);
  149.     
  150.     //fragment attribute access
  151.     STDMETHOD(GetWeight)(THIS_ void* voidFrag, unsigned long& theWeight);
  152.     STDMETHOD(GetI3DShInstance)(THIS_ void* voidFrag, I3DShInstance*& theI3DShInstance);
  153.     STDMETHOD(GetUVSpaceID)(THIS_ void* voidFrag, unsigned long& theUVSpaceID);
  154.     STDMETHOD(GetZ)(THIS_ void* voidFrag, QuickFix& theZ);
  155.     STDMETHOD(GetGNormal)(THIS_ void* voidFrag, VECTOR3D& theNormal);
  156.     STDMETHOD(GetGPosition)(THIS_ void* voidFrag, VECTOR3D& thePosition);
  157.     
  158.     //xxx add other accessors: mask bits, local normal, local position, uv, etc
  159.     };
  160.  
  161. //****** Globally Unique Id **************************************************
  162. //mirrored in CDEFS.H
  163. DEFINE_GUID(IID_I3DExShadowFeature, 0x817684A6, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
  164.  
  165. #undef INTERFACE
  166. #define INTERFACE I3DExShadowFeature
  167.  
  168. typedef struct {
  169.     I3DShGroup*                    fTree;
  170.     I3DShEnvironment*        fBackground;
  171.     I3DShEnvironment*        fBackdrop;
  172.     I3DShEnvironment*        fAtmosphere;
  173.     COLOR3D                            fAmbient;
  174.     BOX2D                                fuvMinMax;
  175.     }
  176. RendEnv;
  177.  
  178.  
  179. typedef struct ShadowIOParms {
  180.     unsigned long             fValidFlags;
  181.     IllumSettings                fIllumSettings;
  182.     unsigned long                fNumberOfRays;
  183.     
  184.     //IN REQUIRED
  185.     I3DExIllumModel*        fIllumModel;
  186.     I3DShLightsource*        fLight;
  187.     const VECTOR3D*            fGPosIn;
  188.     const ShadingOut*        fShading;
  189.     const VECTOR3D*            fEyeDD;
  190.     RendEnv                         fRendEnv;        //(const)
  191.     const VECTOR3D*            fHitNormIn;
  192.     VECTOR3D*                        fReflectDir;
  193.     float                                fBias;
  194.     
  195.     VECTOR3D                        fLightDir;
  196.     NUM3D                                fDistToLight;
  197.     COLOR3D                            fLightColor;
  198.     Boolean                            fCallForShadowEffect;
  199.     
  200.     //IN OPTIONAL
  201.     const Ray3D*                fRayIn;
  202.     I3DShInstance*            fI3DShInstance;    //where the illumination is falling
  203.     const VECTOR3D*            fRealN;
  204.     
  205.     //firsthit stuff
  206.     Boolean                            fIsFirstHit;
  207.     I3DExAbufAccessor*    fAbufAccess;
  208.     VECTOR2D                         fScreenUV;
  209.     
  210.     //OUT REQUIRED
  211.     COLOR3D*                        fResColor;
  212.     COLOR3D*                        fSpecColor;
  213.     
  214.     }ShadowIOParms;
  215.  
  216.  
  217.     
  218. DECLARE_INTERFACE_(I3DExShadowFeature, I3DExRenderFeature) {
  219.     // IUnknown methods
  220.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  221.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  222.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  223.   
  224.     // I3DExtension methods
  225.     STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
  226.     STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
  227.  
  228.   // I3DExDataExchanger methods
  229.     STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE;    // Return NULL if GetResID is to be used
  230.     STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
  231.   STDMETHOD(ExtensionDataChanged) (THIS) PURE;
  232.   STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
  233.     STDMETHOD_(short, GetResID) (THIS) PURE;
  234.     
  235.     // I3DExRenderFeature methods
  236.   STDMETHOD(FrameJuncture) (THIS_ I3DShInstance* theInstance, Boolean moreFrames) PURE;
  237.  
  238.     // I3DExShadowFeature methods
  239.     STDMETHOD(GetShadowNeedFlags) (THIS_ unsigned long& needFlags) PURE;
  240.     STDMETHOD(CalcShadow) (THIS_ ShadowIOParms& theFIOParms) PURE;
  241.     };
  242.     
  243.  
  244.  
  245.     
  246.     
  247.     
  248. //****** Globally Unique Id **************************************************
  249. //mirrored in CDEFS.H
  250. DEFINE_GUID(IID_I3DExAbuf1stHit, 0x817684AB, 0x8B35, 0x11D0, 0xA5, 0x04A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
  251.  
  252. #undef INTERFACE
  253. #define INTERFACE I3DExAbuf1stHit
  254.  
  255. DECLARE_INTERFACE_(I3DExAbuf1stHit, IUnknown) {
  256.     STDMETHOD_(ULONG, GetBoxFiltWidth) (THIS) PURE;
  257.     STDMETHOD_(ULONG, GetPrivDataSize) (THIS) PURE;
  258.     STDMETHOD(SetToken) (THIS_ unsigned long token) PURE;
  259.     STDMETHOD(SetUpPrivData) (THIS_ long h, long v, 
  260.         I3DExAbufAccessor* theAccessor, void* privData) PURE;
  261.     STDMETHOD(ClosePrivData) (THIS_ void* privData) PURE;
  262.     };
  263.     
  264.     
  265.  
  266. //****** Globally Unique Id **************************************************
  267. //mirrored in CDEFS.H
  268. DEFINE_GUID(IID_I3DExReflectionFeature, 0x817684A7, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
  269.  
  270. #undef INTERFACE
  271. #define INTERFACE I3DExReflectionFeature
  272.  
  273.  
  274. typedef struct ReflectionIOParms {
  275.     unsigned long                fValidFlags;
  276.     IllumSettings                fIllumSettings;
  277.     unsigned long                fNumberOfRays;
  278.     
  279.     //RendFtrCommonIn                fInCommon;
  280.     
  281.     I3DExIllumModel*         fIllumModel;
  282.     RTLevelInfo                 fRTLevInfo;
  283.     RendEnv                         fRendEnv;        //(const)
  284.     Boolean                         fGotFlectColor;
  285.     I3DShInstance*             fI3DShInstance;
  286.     VECTOR2D                         fScreenUV;
  287.     const VECTOR3D*            fGPosIn;
  288.     const ShadingOut*        fShading;
  289.     VECTOR3D*                        fReflectDir;
  290.     const Ray3D*                fRayToSplit;
  291.     QuickFix                        fRayT;
  292.     
  293.     COLOR3D                            flectResColor;
  294.  
  295.     } ReflectionIOParms;
  296.  
  297.  
  298.     
  299. DECLARE_INTERFACE_(I3DExReflectionFeature, I3DExRenderFeature) {
  300.     // IUnknown methods
  301.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  302.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  303.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  304.   
  305.     // I3DExtension methods
  306.     STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
  307.     STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
  308.  
  309.   // I3DExDataExchanger methods
  310.     STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE;    // Return NULL if GetResID is to be used
  311.     STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
  312.   STDMETHOD(ExtensionDataChanged) (THIS) PURE;
  313.   STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
  314.     STDMETHOD_(short, GetResID) (THIS) PURE;
  315.     
  316.     // I3DExRenderFeature methods
  317.   STDMETHOD(FrameJuncture) (THIS_ I3DShInstance* theInstance, Boolean moreFrames) PURE;
  318.  
  319.     // I3DExReflectionFeature methods
  320.     STDMETHOD(GetReflectionNeedFlags) (THIS_ unsigned long& needFlags) PURE;
  321.     STDMETHOD(CalcReflection) (THIS_ ReflectionIOParms& theFIOParms) PURE;
  322.     };
  323.  
  324. //****** Globally Unique Id **************************************************
  325. //mirrored in CDEFS.H
  326. DEFINE_GUID(IID_I3DExRefractionFeature, 0x817684A8, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
  327.  
  328. #undef INTERFACE
  329. #define INTERFACE I3DExRefractionFeature
  330.  
  331. typedef struct RefractionIOParms {
  332.     unsigned long                fValidFlags;
  333.     IllumSettings                fIllumSettings;
  334.     unsigned long                fNumberOfRays;
  335.     
  336.     //RendFtrCommonIn                fInCommon;
  337.     
  338.     const VECTOR3D*            fGPosIn;
  339.     const ShadingOut*        fShading;
  340.     const Ray3D*                fRayToSplit;
  341.     RTLevelInfo                 fRTLevInfo;
  342.     NUM3D                                fGrayT;
  343.     QuickFix                        fRayT;
  344.     VECTOR3D*                        fNormal;
  345.     I3DExIllumModel*        fIllumModel;
  346.     RendEnv                            fRendEnv;         //(const)
  347.     I3DShInstance*            fI3DShInstance;
  348.     VECTOR3D*                        fReflectDir;
  349.     Boolean                            fNormalFlipped;
  350.     
  351.     //firsthit stuff
  352.     Boolean                            fIsFirstHit;    //xxx
  353.     I3DExAbufAccessor*    fAbufAccess;
  354.     VECTOR2D                         fScreenUV;
  355.  
  356.     //OUT
  357.     Boolean                            fGotFractColor;
  358.     NUM3D                                fMask;
  359.     COLOR3D                            fFractResColor;
  360.     } RefractionIOParms;
  361.  
  362.  
  363.     
  364. DECLARE_INTERFACE_(I3DExRefractionFeature, I3DExRenderFeature) {
  365.     // IUnknown methods
  366.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  367.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  368.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  369.   
  370.     // I3DExtension methods
  371.     STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
  372.     STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
  373.  
  374.   // I3DExDataExchanger methods
  375.     STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE;    // Return NULL if GetResID is to be used
  376.     STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
  377.   STDMETHOD(ExtensionDataChanged) (THIS) PURE;
  378.   STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
  379.     STDMETHOD_(short, GetResID) (THIS) PURE;
  380.     
  381.     // I3DExRenderFeature methods
  382.   STDMETHOD(FrameJuncture) (THIS_ I3DShInstance* theInstance, Boolean moreFrames) PURE;
  383.  
  384.     // I3DExRefractionFeature methods
  385.     STDMETHOD(GetRefractionNeedFlags) (THIS_ unsigned long& needFlags) PURE;
  386.     STDMETHOD(CalcRefraction) (THIS_ RefractionIOParms& theFIOParms) PURE;
  387.     };
  388.  
  389.  
  390. //****** Globally Unique Id **************************************************
  391. //mirrored in CDEFS.H
  392. DEFINE_GUID(IID_I3DExGenericData, 0x817684A9, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
  393.  
  394.  
  395. #undef INTERFACE
  396. #define INTERFACE I3DExGenericData
  397.  
  398.     
  399. DECLARE_INTERFACE_(I3DExGenericData, I3DExDataExchanger) {
  400.     // IUnknown methods
  401.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  402.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  403.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  404.   
  405.     // I3DExtension methods
  406.     STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
  407.     STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
  408.  
  409.   // I3DExDataExchanger methods
  410.     STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE;    // Return NULL if GetResID is to be used
  411.     STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
  412.   STDMETHOD(ExtensionDataChanged) (THIS) PURE;
  413.   STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
  414.     STDMETHOD_(short, GetResID) (THIS) PURE;
  415.     
  416.     // I3DExGenericData methods
  417.     };
  418.  
  419.  
  420. //Private data for attachability list (stored in the 'Cmpp' resource of same ID)
  421. #define kVariableLengthArray 1
  422. typedef struct    {
  423.     unsigned long            fNumAttaches;
  424.     unsigned long            fAttachType[kVariableLengthArray];
  425.     } ExAttachData;
  426.  
  427.  
  428.  
  429.  
  430.  
  431. #endif
  432.  
  433.  
  434.